#include<iostream>
#include<vector>
#include<deque>
using namespace std;

void ins(deque<int> &q, int x, int m) {
    if(q.size() < m) q.push_back(x);
    else {q.pop_front(); q.push_back(x);}
}

int main() {
    int m, n, cnt = 0;
    cin >> m >> n;
    deque<int> q;
    vector<int> a(n, -1);
    for(int i=0; i<n; i++)  cin >> a[i];
    for(int i=0; i<n; i++) {
        bool flag = false;
        for(auto it=q.begin(); it!=q.end(); it++) {
            if(*it == a[i]) flag = true;
        }
        if(!flag) {ins(q, a[i], m); cnt++;}
    }

    cout << cnt << endl;
    return 0;
} 